import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class portal here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class portal  extends Actor
{
    int x,y;

    public portal(int w,int h, int a, int b){
        x=a;
        y=b;     
        setImage(new GreenfootImage(w,h));
    }

    public void act() 
    {
       Actor it1 = getOneIntersectingObject(Enemy.class);
       Actor it2 = getOneIntersectingObject(fall.class);
       Actor it3 = getOneIntersectingObject(platform.class);
       Actor it4 = getOneIntersectingObject(Zony.class);
       Actor it5 = getOneIntersectingObject(bullet.class);
       Actor it6 = getOneIntersectingObject(sword.class);
       if(it1!=null)
           it1.setLocation(x,y);  
       if(it2!=null)
           it2.setLocation(x,y); 
       if(it3!=null)
           it3.setLocation(x,y); 
       if(it4!=null)
           it4.setLocation(x,y); 
       if(it5!=null)
           it5.setLocation(x,y); 
       if(it6!=null)
           it6.setLocation(x,y); 
    }    
}
